﻿using System;
using System.Collections.Generic;
using System.Data.Entity.Infrastructure;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GlobalObjects;

namespace DataAccessLayer
{
  public class ContactUsEntity
    {
      /// <summary>
      /// inserts the given contact details into the database
      /// </summary>
      /// <param name="contact">contact information</param>
         public void insertToContactUs_DAL(ContactUs contact)
        {
         using (var context = new MSR2DBEntities())
         {
             var nContactUs = new contact_us
             {
                 fullname = contact.Fullname,
                 email = contact.Email,
                 subject = contact.Subject,
                 message = contact.Message,
                 time = contact.Time
             };
             context.contact_us.Add(nContactUs);
             context.SaveChanges();
             }
         }

    }
}
